package wap.rockvilletech.portal;

import java.net.URL;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;
import org.apache.log4j.helpers.Loader;
import org.apache.log4j.xml.DOMConfigurator;

public final class AppContextListener implements ServletContextListener {
	
	private static final Logger log = Logger.getLogger(AppContextListener.class);
	
	
	public void contextDestroyed(ServletContextEvent sce) {
		log.info("contextDestroyed is called");
	}

	
	public void contextInitialized(ServletContextEvent sce) {
		try {
			URL url = Loader.getResource("log4j-config.xml");
			DOMConfigurator.configure(url);
	//		DOMConfigurator.configure("log4j-config.xml");
		} catch(Exception e) {
			
		}
		log.info("contextInitialized is called");		
	}

}
